package com.eqdd.yiqidian.bean;

import android.os.Parcel;
import android.os.Parcelable;
import android.text.TextUtils;

import com.eqdd.yiqidian.utils.DateUtil;
import com.google.gson.annotations.SerializedName;

import org.greenrobot.greendao.annotation.Entity;
import org.greenrobot.greendao.annotation.Id;
import org.greenrobot.greendao.annotation.Generated;

/**
 * Created by lvzhihao on 17-4-6.
 */
@Entity
public class User implements Parcelable {
    @Id(autoincrement = true)
    Long id;

    /**
     * iphoto : 0
     * uname : 15286837835
     * upname : 游客15286837835
     * name : 0
     * sex : 0
     * authen : 0
     * Guid : d0f8bdf9195e4e309c4a200a686c274c
     * EQDCode : 0
     * addTime : 2017/7/1 9:35:08
     */

    private String iphoto;
    private String uname;
    @SerializedName("upname")
    private String pname;
    private String name;
    private int sex;
    private int authen;
    private String Guid;
    private String EQDCode;
    private String addTime;
    private String comid;
    private int companyId;
    private String company;
    private String department;
    private String post;
    private String jobNumber;
    private int departId;
    private int postId;
    private int step;
    private String username;
    private int isAdmin;
    private String workImage;
    private String Signature;
    private String signEntryTime;
    private boolean isleader;


    public boolean isIsleader() {
        return isleader;
    }

    public void setIsleader(boolean isleader) {
        this.isleader = isleader;
    }

    public Long getId() {
        return this.id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getIphoto() {
        return this.iphoto;
    }

    public void setIphoto(String iphoto) {
        this.iphoto = iphoto;
    }

    public String getUname() {
        return this.uname;
    }

    public void setUname(String uname) {
        this.uname = uname;
    }

    public String getPname() {
        return this.pname;
    }

    public void setPname(String pname) {
        this.pname = pname;
    }

    public String getName() {
        return this.name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getSex() {
        return this.sex;
    }

    public void setSex(int sex) {
        this.sex = sex;
    }

    public int getAuthen() {
        return this.authen;
    }

    public void setAuthen(int authen) {
        this.authen = authen;
    }

    public String getGuid() {
        return this.Guid;
    }

    public void setGuid(String Guid) {
        this.Guid = Guid;
    }

    public String getEQDCode() {
        return this.EQDCode;
    }

    public void setEQDCode(String EQDCode) {
        this.EQDCode = EQDCode;
    }

    public String getAddTime() {
        return this.addTime;
    }

    public void setAddTime(String addTime) {
        this.addTime = addTime;
    }

    public String getComid() {
        return this.comid;
    }

    public void setComid(String comid) {
        this.comid = comid;
    }

    public int getCompanyId() {
        return this.companyId;
    }

    public void setCompanyId(int companyId) {
        this.companyId = companyId;
    }

    public String getCompany() {
        return this.company;
    }

    public void setCompany(String company) {
        this.company = company;
    }

    public String getDepartment() {
        return this.department;
    }

    public void setDepartment(String department) {
        this.department = department;
    }

    public String getPost() {
        return this.post;
    }

    public void setPost(String post) {
        this.post = post;
    }

    public String getJobNumber() {
        return this.jobNumber;
    }

    public void setJobNumber(String jobNumber) {
        this.jobNumber = jobNumber;
    }

    public int getDepartId() {
        return this.departId;
    }

    public void setDepartId(int departId) {
        this.departId = departId;
    }

    public int getPostId() {
        return this.postId;
    }

    public void setPostId(int postId) {
        this.postId = postId;
    }

    public int getStep() {
        return this.step;
    }

    public void setStep(int step) {
        this.step = step;
    }

    public String getUsername() {
        return this.username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public int getIsAdmin() {
        return this.isAdmin;
    }

    public void setIsAdmin(int isAdmin) {
        this.isAdmin = isAdmin;
    }

    public String getWorkImage() {
        return this.workImage;
    }

    public void setWorkImage(String workImage) {
        this.workImage = workImage;
    }

    public String getSignature() {
        return this.Signature;
    }

    public void setSignature(String Signature) {
        this.Signature = Signature;
    }

    public String getSignEntryTime() {

        return TextUtils.isEmpty(this.signEntryTime)?"未入职": this.signEntryTime;
    }

    public void setSignEntryTime(String signEntryTime) {
        this.signEntryTime = signEntryTime;
    }

    public User() {
    }


    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeValue(this.id);
        dest.writeString(this.iphoto);
        dest.writeString(this.uname);
        dest.writeString(this.pname);
        dest.writeString(this.name);
        dest.writeInt(this.sex);
        dest.writeInt(this.authen);
        dest.writeString(this.Guid);
        dest.writeString(this.EQDCode);
        dest.writeString(this.addTime);
        dest.writeString(this.comid);
        dest.writeInt(this.companyId);
        dest.writeString(this.company);
        dest.writeString(this.department);
        dest.writeString(this.post);
        dest.writeString(this.jobNumber);
        dest.writeInt(this.departId);
        dest.writeInt(this.postId);
        dest.writeInt(this.step);
        dest.writeString(this.username);
        dest.writeInt(this.isAdmin);
        dest.writeString(this.workImage);
        dest.writeString(this.Signature);
        dest.writeString(this.signEntryTime);
        dest.writeByte(this.isleader ? (byte) 1 : (byte) 0);
    }

    public boolean getIsleader() {
        return this.isleader;
    }

    protected User(Parcel in) {
        this.id = (Long) in.readValue(Long.class.getClassLoader());
        this.iphoto = in.readString();
        this.uname = in.readString();
        this.pname = in.readString();
        this.name = in.readString();
        this.sex = in.readInt();
        this.authen = in.readInt();
        this.Guid = in.readString();
        this.EQDCode = in.readString();
        this.addTime = in.readString();
        this.comid = in.readString();
        this.companyId = in.readInt();
        this.company = in.readString();
        this.department = in.readString();
        this.post = in.readString();
        this.jobNumber = in.readString();
        this.departId = in.readInt();
        this.postId = in.readInt();
        this.step = in.readInt();
        this.username = in.readString();
        this.isAdmin = in.readInt();
        this.workImage = in.readString();
        this.Signature = in.readString();
        this.signEntryTime = in.readString();
        this.isleader = in.readByte() != 0;
    }

    @Generated(hash = 758615935)
    public User(Long id, String iphoto, String uname, String pname, String name,
            int sex, int authen, String Guid, String EQDCode, String addTime,
            String comid, int companyId, String company, String department,
            String post, String jobNumber, int departId, int postId, int step,
            String username, int isAdmin, String workImage, String Signature,
            String signEntryTime, boolean isleader) {
        this.id = id;
        this.iphoto = iphoto;
        this.uname = uname;
        this.pname = pname;
        this.name = name;
        this.sex = sex;
        this.authen = authen;
        this.Guid = Guid;
        this.EQDCode = EQDCode;
        this.addTime = addTime;
        this.comid = comid;
        this.companyId = companyId;
        this.company = company;
        this.department = department;
        this.post = post;
        this.jobNumber = jobNumber;
        this.departId = departId;
        this.postId = postId;
        this.step = step;
        this.username = username;
        this.isAdmin = isAdmin;
        this.workImage = workImage;
        this.Signature = Signature;
        this.signEntryTime = signEntryTime;
        this.isleader = isleader;
    }

    public static final Creator<User> CREATOR = new Creator<User>() {
        @Override
        public User createFromParcel(Parcel source) {
            return new User(source);
        }

        @Override
        public User[] newArray(int size) {
            return new User[size];
        }
    };
}